package com.nine.flow.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nine.flow.dtos.MyFlowProcDefDto;
import com.nine.flow.mapper.MyFlowDefinitionMapper;
import com.nine.flow.service.MyFlowDefinitionService;
import com.nine.flow.vos.MyFlowProcDefVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author nine
 * @version 1.0
 * @description TODO
 * @date 2023/7/20 22:37
 */
@Slf4j
@Service
public class MyFlowDefinitionServiceImpl extends ServiceImpl<MyFlowDefinitionMapper, MyFlowProcDefDto> implements MyFlowDefinitionService {

	/**
	 * 流程定义列表
	 *
	 * @param vo
	 * @return
	 */
	@Override
	public IPage<MyFlowProcDefDto> listPage(MyFlowProcDefVo vo) {
		log.info("vo::::", vo);
		// 检查分页参数
		vo.check();

		IPage<MyFlowProcDefDto> page = new Page<>(vo.getPageNo(), vo.getPageSize());

		return this.baseMapper.selectDeployList(page, vo.getName());
	}
}
